package com.lzq.train.batch.job;

import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

/**
 * 关闭并发执行
 */
@DisallowConcurrentExecution
public class QuartzTestJob implements Job {

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        System.out.println("Quartz 开始。。。");

//        try {
//            Thread.sleep(6000); // 模拟定时任务 并发执行
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }

        System.out.println("Quartz 结束。。。");
    }
}
